package com.csmht.tododemo.controller.user;

import com.csmht.tododemo.annotation.RoleIntercept;
import com.csmht.tododemo.pojo.dto.ReportDTO;
import com.csmht.tododemo.pojo.enumeration.ReportEnum;
import com.csmht.tododemo.pojo.enumeration.RoleEnum;
import com.csmht.tododemo.result.Result;
import com.csmht.tododemo.service.ReportService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController("/userReportController")
@RequestMapping("/user/report")
@Slf4j
@RoleIntercept(roles = {RoleEnum.ADMIN, RoleEnum.USER})
public class ReportController {


    @Resource
    private ReportService reportService;

    @PutMapping()
    public Result<Object> reportTodo(@RequestBody ReportDTO reportDTO){
        reportService.add(reportDTO);
        return Result.success();
    }



}
